/**   
 * @Title: Constansts.java 
 * @Package: com.rename.icode.utils 
 * @Description: Administrator版权所有
 * @author Administrator  
 * @date 2015-2-11 下午4:34:45 
 * @version  
 */

package com.rename.icode.comm;

import android.os.Environment;

/**
 * @Description 常量
 * @author WangXinMing
 * @date 2015-2-11 下午4:34:45
 * @version V1.0
 */

public class Constants {
	public static String SDCARD_ROOT_PATH = Environment.getExternalStorageDirectory().getAbsolutePath();

	public final static int DISCOVERY_TIMEOUT = 1000 * 30;

	// ================================================
	public static final int SERVER_SUCCESS = 1;// 登录成功
	public static final int SERVER_FAIL = -1; // 登录失败
	// ================================================
	
	public static final String FAIL = "Fail"; // 注册或者登录失败

	// ================================================
	public static final String SERVER_URL = "http://192.168.191.5:85/OnlineCompiler/";// 服务器地址
	public static final String LOGIN_URL = SERVER_URL + "LoginServer.php";
	public static final String REGISTER_URL = SERVER_URL +  "RegisterServer.php";
	public static final String UPLOAD_URL = SERVER_URL + "UploadServer.php";
	public static final String DOWNLOAD_URL = SERVER_URL + "code/user/";
	public static final String COMPILER_URL = SERVER_URL + "CompilerServer.php";
	// ================================================

	public static final String HTML_ROOT_DIR = "file:///android_asset/OnlineCompiler/"; // 嵌入到webview中的HTML存放的根目录
	
	// ================================================//SDCard中文件路径
	public static final String ICODE_ROOT_PATH = "/icode";
	public static final String CACHE_PATH = ICODE_ROOT_PATH + "/cache";
	public static final String LOG_PATH = ICODE_ROOT_PATH + "/log";
	public static final String CODE_PATH = ICODE_ROOT_PATH + "/code";

	public static final String LOG_PREFIX = "normal";
	// ================================================

	// ================================================
	public static final int REQCODE_LOGIN_OP = 1; // 登录请求
	public static final int REQCODE_EDITVIEW_OP = 2; // 显示编辑界面请求
	// ================================================

	public static final String APP_SET_PREF = "app_set_pref"; // 应用配置，存于sharedpreferences中

	public static final String USERNAME = "username"; // 登录名
	public static final String PASSWORD = "password"; // 密码
	public static final String DATA_ROOT_PATH = "data_root_path"; // 手机上数据存储根目录

	public static final String APP_HOST = "app_host"; // 服务器地址
	public static final String APP_PORT = "app_port"; // 服务器端口

	// ================================================语言ID
	public static final int CODE_C = 0;
	public static final int CODE_CPP = 1;
	public static final int CODE_JAVA = 2;
	// ================================================

	// ================================================
	public static final String JS_GET_CODE = "javascript:window.handler.save(editor.getValue());";
	public static final String JS_INPUT_SYMBOL = "";
	public static final String CODE_HTML = "index.html";
	// ================================================

	// ================================================//文件类型
	public static final String TYPE_C = "c";
	public static final String TYPE_CPP = "c++";
	public static final String TYPE_JAVA = "java";
	public static final String TYPE_OTHER = "#";
	// ================================================
	
	//=================================================//文件后缀
	public static final String SUFFIX_C = ".c";
	public static final String SUFFIX_CPP = ".cpp";
	public static final String SUFFIX_JAVA = ".java";
	//=================================================

	// ================================================代码文件夹
	public static final String CODE_ROOT_DIR = SDCARD_ROOT_PATH + ICODE_ROOT_PATH + "/code/";
	public static final String CODE_LOCAL_DIR = CODE_ROOT_DIR + "local/";
	public static final String CODE_SERVER_DIR = CODE_ROOT_DIR + "server/";
	// ================================================

	// ================================================
	public static final String LOCAL_REFRESH = "local_refresh";// 刷新本地文件列表
	public static final String SERVER_REFRESH = "server_refresh";// 刷新本地文件列表
	public static final String PAGE_LOAD_FINISHED = "page_load_finished"; // webview中网页加载完成
	// ================================================

	// =================================================
	public static final String[] TYPES = new String[] { TYPE_C, TYPE_CPP,
			TYPE_JAVA };
	// =================================================

	//==================================================
		public static final String EXE_FILE = "test";
	//==================================================
	
	// =================================================终端命令
	public static final String CMD_PLAIN = "[plain] view plaincopy";
	public static final String CMD_EXPORT_GCCHOME = "export GCCHOME=/data/gcc";
	public static final String CMD_EXPORT_GCCPATH = "export GCCPATH=$GCCHOME/bin:$GCCHOME/arm-linux-androideabi/bin:$GCCHOME/libexec/";
	public static final String CMD_EXPORT_PATH = "export PATH=$PATH:$GCCHOME:$GCCPATH";
	public static final String CMD_GCC_ROOT = "cd data";
	public static final String CMD_EXIT = "exit";
	public static final String CMD_RUN = "./" + EXE_FILE;
	// =================================================
	
	public static final String UPLOAD_SUCCESS = "1"; // 上传成功
	public static final String UPLOAD_FAIL = "-1"; // 上传失败
	
	public static final String GUEST = "guest"; // 游客账户
	
	
}
